package vip.george.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.george.service.AnnotationAuthService;

/**
 * @author gehaodong
 * @since 2024/3/19
 * <p>
 *     测试基于注解的权限控制
 * </P>
 */


@RestController
public class AnnotationAuthController {

    @Autowired
    private AnnotationAuthService annotationAuthService;


    @GetMapping(value = "/add", produces = "text/html;charset=utf-8")
//    @RequiresPermissions("add")
    public String add() {
        System.out.println("用户请求了add接口");
        return annotationAuthService.add();
    }

    @GetMapping(value = "/delete", produces = "text/html;charset=utf-8")
//    @RequiresPermissions("delete")
    public String delete() {
        System.out.println("用户请求了delete接口");
        return annotationAuthService.delete();
    }

}
